using B.S.Domain.Dto.AICustomerServiceDTO;
using B.S.Requst;
using MediatR;

namespace B.S.Data.MES.API.Applications.AICustomerService.Commands
{
    /// <summary>
    /// 创建知识库命令
    /// </summary>
    public class CreateKnowledgeCommand : IRequest<APIRequst<int>>
    {
        public KnowledgeCreateDTO Knowledge { get; set; } = new();
    }

    /// <summary>
    /// 更新知识库命令
    /// </summary>
    public class UpdateKnowledgeCommand : IRequest<APIRequst<int>>
    {
        /// <summary>
        /// 知识库ID
        /// </summary>
        public int KnowledgeId { get; set; }

        public KnowledgeCreateDTO Knowledge { get; set; } = new();
    }

    /// <summary>
    /// 删除知识库命令
    /// </summary>
    public class DeleteKnowledgeCommand : IRequest<APIRequst<int>>
    {
        /// <summary>
        /// 知识库ID
        /// </summary>
        public int KnowledgeId { get; set; }
    }

    /// <summary>
    /// 查询知识库命令
    /// </summary>
    public class QueryKnowledgeCommand : IRequest<APIRequst<APIPageing<List<KnowledgeResponseDTO>>>>
    {
        public KnowledgeQueryDTO Query { get; set; } = new();
    }

    /// <summary>
    /// 启用/禁用知识库命令
    /// </summary>
    public class ToggleKnowledgeStatusCommand : IRequest<APIRequst<int>>
    {
        /// <summary>
        /// 知识库ID
        /// </summary>
        public int KnowledgeId { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
    }

    /// <summary>
    /// 搜索知识库命令（用于AI匹配）
    /// </summary>
    public class SearchKnowledgeCommand : IRequest<APIRequst<List<KnowledgeResponseDTO>>>
    {
        /// <summary>
        /// 搜索关键词
        /// </summary>
        public string Keyword { get; set; } = string.Empty;

        /// <summary>
        /// 匹配度阈值
        /// </summary>
        public decimal MatchThreshold { get; set; } = 0.5m;

        /// <summary>
        /// 返回结果数量限制
        /// </summary>
        public int Limit { get; set; } = 5;
    }
}
